package cs543.library.rmi;

import java.util.HashMap;


public class RmiServerRegistry {
	static HashMap<String, RmiServerInterface> directory = null;
	
	public RmiServerRegistry () {
		if (directory == null)
			directory = new HashMap<String, RmiServerInterface> ();
	}
	
	public void register (String name, RmiServerInterface clazz) {
		if (directory.containsValue (name)) directory.remove (name);
		directory.put (name, clazz);
	}
	
	public RmiServerInterface lookup (String name) {
		return directory.get (name);
	}
}
